class CreateAdmins < ActiveRecord::Migration
  def self.up
    create_table :admins, :options => 'CHARSET=utf8, ENGINE=Innodb', :force => true do |t|
      t.column :login,                     :string
      t.column :email,                     :string
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime
      t.column :last_login,                :datetime
      t.column :last_ip,                   :string
      t.column :admin_group_id,            :integer
      t.column :deleted_at, :datetime
      t.timestamps
    end
    
    # 导入默认数据
    Admin.import_data
  end

  def self.down
    drop_table :admins
  end
end
